package org.codeart.api_driver.remote;

import org.codeart.common.dto.OrderInfo;
import org.codeart.common.request.OrderRequest;
import org.codeart.common.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "service-order")
public interface ServiceOrderClient {

    @PostMapping("/order/to-pick-up-passenger")
    R<Void> toPickUpPassenger(@RequestBody OrderRequest orderRequest);

    /**
     * 到达乘客上车点
     */
    @PostMapping("/order/arrived-departure")
    R<Void> arriveDeparture(@RequestBody OrderRequest orderRequest);

    /**
     * 司机接到乘客
     */
    @PostMapping("/order/pick-up-passenger")
    R<Void> pickUpPassenger(@RequestBody OrderRequest orderRequest);

    /**
     * 乘客到达目的地，行程终止
     */
    @PostMapping("/order/passenger-get-off")
    R<Void> passengerGetOff(@RequestBody OrderRequest orderRequest);

    @PostMapping("/order/cancel")
    R<Void> cancel(@RequestParam("orderId") Long orderId, @RequestParam("identity") String identity);

    @PostMapping("/order/push-pay-info")
    R<Void> pushPayInfo(@RequestBody OrderRequest orderRequest);

    @GetMapping("/order/detail")
    R<OrderInfo> detail(@RequestParam("orderId") Long orderId);

    @GetMapping("/order/current")
    R<OrderInfo> current(@RequestParam("phone") String phone, @RequestParam("identity") String identity);
}
